<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>1-函数的定义方式</title>
</head>
<body>
    <script type="text/javascript">
        //1.使用function关键字
        function setDataHtml(){

        }
        setDataHtml();

        //2.使用匿名函数
        var html = function(){
            console.log('123');
        }
        html();

        //3.new Function('参数1','参数2','函数体');

        var f = new Function('x','y','add(x,y)');

        function add(x,y){
            console.log(x+y);
        }
        f(1,3);

        //函数也属于对象
        console.log(f instanceof Object);//true

        //数组
        var arr = [];
        console.log(arr instanceof Array);//true

        //检测变量是什么类型的 typeof 


    </script>
</body>
</html>